Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

322
Vistas
Using mysql-connector-java in Flink: No suitable driver found when connecting to mysql >= 8.0.16

I am writing a simple Flink program to move data from MySQL to Mongo.

I'm using mysql-connector-java 8.0.16.

The problem

When I try to connect to our test env DB (MySQL 8.0.15) the program works just fine. The connection string looks like this:

jdbc:mysql://my-test-db-url:3306/my_db_name

But once I connect it to our production DB (MySQL 8.0.16), I got:

java.sql.SQLException: No suitable driver found for jdbc:mysql://my-prod-db-url:3306/my_db_name

The only difference of these DBs is the minor version (15 vs 16).

What I have tried

Upgrading test DB to match prod DB version

I upgraded my test DB to 8.0.16 to see if it's a problem with that version of mysql server. And indeed now I can't connect to test DB, too, getting the same exception.

After that I continued to upgrade both mysql-connector-java and test DB to 8.0.17, but the problem still persists.

In my other projects I can connect to those mysql DBs just fine (using spring data jpa with mysql-connector-java 8.0.18). So the db server shouldn't have any problem.

Manually put mysql-connector-java jar into flink/lib folder

This didn't work

Registering the driver manually in main class and my mysql source function's open method

no error was thrown in main class

// tried both
Class.forName("com.mysql.jdbc.Driver").newInstance();
Class.forName("com.mysql.cj.jdbc.Driver").newInstance();

I also made sure after running maven package, my fat jar does contain the connector class files.

Now I'm pretty much clueless. Somebody please save me.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I resolved same issue using Class.forName("org.sqlite.JDBC") (I were using sqlite) before calling DriverManager.getConnection. It's almost same that you've tried but without calling newInstance().

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda